home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7780 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: newsbf02.news.aol.com!not-for-mail
  2. From: cperkins@aol.com (C Perkins)
  3. Newsgroups: comp.lang.c++
  4. Subject: overloading new operator
  5. Date: 18 Feb 1996 17:52:11 -0500
  6. Organization: America Online, Inc. (1-800-827-6364)
  7. Sender: root@newsbf02.news.aol.com
  8. Message-ID: <4g8air$6a0@newsbf02.news.aol.com>
  9. Reply-To: cperkins@aol.com (C Perkins)
  10. NNTP-Posting-Host: newsbf02.mail.aol.com
  11.  
  12. Does anyone have a simple sample of overriding the new operator? How do  I
  13. use new placement with constructors that take multiple arguments?
  14.  
  15. I have a number of classes which have constructors that take multiple
  16. arguments.  Is it possible to dynamically create objects of these classes
  17. using placement?  Can anyone show me an example?  
  18.  
  19. Or am I going at this the wrong way?  If I overload new with placement, is
  20. my task simply to allocate the memory, and will the compiler then handle
  21. calling the correct constructor? 
  22.  
  23. I've gone through nearly every book C++ I've got, and all mention
  24. overloading new, but none have any examples.
  25.  
  26. Thanks
  27.  
  28. Chris Perkins
  29. cperkins@medialab.com
  30. cperkins@aol.com
  31.